import request from "@/utils/request";

const OPPORTUNITY_BASE_URL = "/api/v1/opportunity";

const OpportunityAPI = {
  /**
   * 获取机会列表
   */
  getDesignerOpportunityList(data: any) {
    return request<any, any>({
      url: `${OPPORTUNITY_BASE_URL}/page`, // 获取机会列表
      method: "post",
      data,
    });
  },
  /**
   * 获取材料商机会列表
   */
  getMaterialOpportunityList(data: any) {
    return request<any, any>({
      url: `${OPPORTUNITY_BASE_URL}/material/page`, // 获取材料商机会列表
      method: "post",
      data,
    });
  },
  /**
   * 添加关注
   * type 1关注 2取消关注
   */
  addFocus(data: { opportunityId: string; opportunityType: string; type: string }) {
    return request<any, any>({
      url: `${OPPORTUNITY_BASE_URL}/add/focus`, // 添加关注
      method: "get",
      params: data,
    });
  },
  /**
   * 打招呼
   * @param data
   */
  sayHello(data: any) {
    return request<any, any>({
      url: `${OPPORTUNITY_BASE_URL}/sayHello`, // 获取机会详情
      method: "post",
      data,
    });
  },
  /**
   * 建材机会自己的品类列表
   * 获取商品分类列表
   * @returns 商品分类列表
   */
  getGoodsCategoryList() {
    return request<any, any>({
      url: `${OPPORTUNITY_BASE_URL}/material/categoryList`, // 获取商品分类列表
      method: "post",
    });
  },

  getCheckReceiveCoupon(data: any) {
    return request({
      url: `/api/v1/requirementPayment/checkReceiveCoupon`,
      method: "post",
      data,
    });
  },
};
export default OpportunityAPI;
